using System.ComponentModel.DataAnnotations;

namespace ClassDemo.Model.DTO;

/// <summary>
/// 教师更新数据传输对象
/// </summary>
public class TeacherUpdateDto
{
    /// <summary>
    /// 教师姓名
    /// </summary>
    [Required(ErrorMessage = "教师姓名不能为空")]
    [StringLength(50, ErrorMessage = "教师姓名长度不能超过50个字符")]
    public string Name { get; set; } = string.Empty;

    /// <summary>
    /// 手机号
    /// </summary>
    [Required(ErrorMessage = "手机号不能为空")]
    [Phone(ErrorMessage = "手机号格式不正确")]
    public string Mobile { get; set; } = string.Empty;

    /// <summary>
    /// 新密码（可选，如果不修改密码则不传）
    /// </summary>
    [MinLength(6, ErrorMessage = "密码长度不能少于6位")]
    [MaxLength(20, ErrorMessage = "密码长度不能超过20位")]
    public string? NewPassword { get; set; }
}